<!DOCTYPE HTML>
<html>
<head>
    {include file='common_header'}
</head>
<body>
<div class="page-container">
    <form action="{:Url('add')}" method="post" class="form form-horizontal" id="form-admin-role-add">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>上级省份：</label>
            <div class="formControls col-xs-7 col-sm-9">
                <span class="select-box">
                    <select name="shop_pid"   class="select" datatype="*" nullmsg="请选择上级省份"  onchange="onchanges($(this))">
                            <option disabled selected value="0">请选择上级省份</option>
                            {volist name=":getlists('province')" id="v"}

                                  <option value="{$v['id']}"               {if condition="$v['id'] eq $data['p_id']"}selected{/if}>{$v['p_name']}</option>
                            {/volist}
                     </select>
				</span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>上级市区：</label>
            <div class="formControls col-xs-7 col-sm-9">
                <span class="select-box">
                    <select name="shop_cid"  id="pid"    class="select" datatype="*" nullmsg="请选择上级市区" >
                           {volist name=":getlists('city')" id="v"}
                                  <option value="{$v['id']}"   {if condition="$v['id'] eq $data['c_id']"}selected{/if}>{$v['c_name']}</option>
                            {/volist}
                     </select>
				</span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4   col-sm-3"><span class="c-red">*</span>县/区名称：</label>
            <div class="formControls col-xs-7 col-sm-9">
                <input type="text" class="input-text" value="{$data['a_name']}" placeholder="" datatype="*" nullmag="请输入市区名称"  name="a_name">
            </div>
        </div>

        <div class="row cl pt-10"  >
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-5">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;确定&nbsp;&nbsp;">

            </div>
        </div>
    </form>
</div>
<!--_footer 作为公共模版分离出去-->
{include file='common_footer'}
<script>
    var url="{:Url('getcitylists')}";
    function onchanges(obj) {
        $pid=obj.val();
        $.getJSON(url,{id:$pid,type:1},function (result) {
            $.each(result, function(i, v){
                $("#pid").append("<option value="+v.id+">"+v.c_name+"</option>");
            });
        })
    }
</script>
</body>
</html>